using Services;
using UnityEngine;
using UnityEngine.UI;

public class HUD_Time : MonoBehaviour
{
    private Clock clock;
    [SerializeField]
    private Text m_text;
    [SerializeField]
    private Text m_text_year;

    private void Start()
    {
        clock = ServiceLocator.Get<Clock>();
        clock.TimeChange += OnTimeChange;
        OnTimeChange();
    }

    private void OnTimeChange()
    {
        m_text_year.text = clock.GetInformationYear();
        m_text.text = clock.GetInformation();
    }
}
